﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using TraceThisItem.Domain.Initializers;

namespace TraceThisItem.Domain
{
    public class PersistenceManager : DbContext
    {
        public DbSet<Item> Items { get; set; }
        public DbSet<ItemStatus> ItemStatus { get; set; }
        public DbSet<ItemType> ItemTypes { get; set; }
        public DbSet<Project> Projects { get; set; }
        public DbSet<StatusNode> StatusNodes { get; set; }
        //public DbSet<StatusType> StatusTypes { get; set; }
        public DbSet<Team> Teams { get; set; }
        public DbSet<User> Users { get; set; }
        public DbSet<Workflow> Workflows { get; set; }


        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {

            modelBuilder.Configurations
                .Add(new UserConfiguration())
                .Add(new TeamConfiguration())
                .Add(new ProjectConfiguration())
                .Add(new ItemTypeConfiguration())
                .Add(new WorkFlowConfiguration())
				.Add(new StatusNodeConfiguration())
                .Add(new ItemConfiguration())
                .Add(new ItemStatusConfiguration());

        }
    }
}
